package com.muyu.entity;

import com.muyu.group.AddGroup;
import com.muyu.group.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @ClassName: CompanyEntity
 * @Author: Zirun.Xin
 * @Date: 2025/4/7 下午5:19
 * @Version: 1.0
 * @Description: 公司实体
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CompanyEntity {

    /**
     * 公司id
     */
    @NotNull(message = "公司id不能为空", groups = UpdateGroup.class)
    private Integer companyId;

    /**
     * 公司名称
     */
    @NotBlank(message = "公司名称不能为空", groups = {UpdateGroup.class, AddGroup.class})
    private String companyName;

    /**
     * 用户对象
     */
    @Valid
    @NotNull(message = "用户对象不能为空", groups = UpdateGroup.class)
    private UserEntity userEntity;
}
